// 书写webpack
var path = require('path')
module.exports = {
  // 入口
  // entry:"./src/index.js"
  entry: {
    main: './main.js'
  },
  //输出
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: 'mybundel.js'
  },
  //模式  development 开发模式     生产模式（线上模式）production
  mode: 'production',
  // loader
  module: {
    rules: [
      {
        //es6 解析成es5的loader    babel-loader
        test: /\.m?js$/,
        exclude: /(node_modules|bower_components)/,
        use: {
          loader: 'babel-loader',
          options: {
            presets: ['@babel/preset-env']
          }
        }
      },
      {
        //css-loader style-loader  解析css的loader
        test: /\.css$/i,
        use: ['style-loader', 'css-loader']
      }
    ]
  }

  //插件
}
